import http from './http'

interface ApiResponse {
  code: number
  message: string
  data: any
}

export const get = (url: string, params?: any): Promise<ApiResponse> => {
  return http.get(url, { params })
}

export const post = (url: string, data?: any): Promise<ApiResponse> => {
  return http.post(url, data)
}

export const deleted = (url: string, params?: any): Promise<ApiResponse> => {
  return http.delete(url, { params })
}
